//
//  FCCustomIolAndCurveButton.m
//  ZhuKuang
//
//  Created by mafy on 17/7/12.
//  Copyright © 2017年 jjkj. All rights reserved.
//

#import "FCCustomIolAndCurveButton.h"

@implementation FCCustomIolAndCurveButton

- (instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    
    if (self) {
        
        [self setImage:[UIImage imageNamed:@"blue_arow"] forState:UIControlStateNormal];
        [self setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft];
        [self setTitleColor:COLOR(12, 169, 215, 1) forState:UIControlStateNormal];
        self.layer.cornerRadius = 4.0f;
        self.layer.masksToBounds = YES;
        self.layer.borderWidth = 1.0f;
        self.layer.borderColor = COLOR(13, 169, 215, 1).CGColor;
    }
    
    return self;
}

- (CGRect)titleRectForContentRect:(CGRect)contentRect{
    
    CGFloat x = 10;
    CGFloat y = 0;
    CGFloat w = contentRect.size.width - 18 - 10 - 10;
    CGFloat h = contentRect.size.height;
    
    CGRect rect = CGRectMake(x, y, w, h);
    
    return rect;
}

//18 * 12
- (CGRect)imageRectForContentRect:(CGRect)contentRect{
    
    CGFloat x = contentRect.size.width - 18 - 10;
    CGFloat y = (contentRect.size.height - 12) / 2;
    CGFloat w = 18;
    CGFloat h = 12;
    
    CGRect rect = CGRectMake(x, y, w, h);
    
    return rect;
}



@end
